from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from info import create_app, db
from info import models
import pymysql
pymysql.install_as_MySQLdb()

# 创建app对象
app = create_app("development")
# 创建数据迁移对象
Migrate(app, db)
# 创建项目管理对象
manager = Manager(app)
# 添加迁移指令
manager.add_command("db", MigrateCommand)


# 4.运行flask项目
if __name__ == '__main__':
    manager.run()
